import QtQuick 2.0
import QtQuick.Window 2.0
import QtQuick.Controls 1.0

Window {
    visible: true
    width: 640
    height: 480

    Button {
        id: btn1
        width: 150
        height: 40
        onClicked: {
            pageLoader.source = "qml-rtsp-player.qml"
        }
        text: "Qml rtsp player"
    }

    Button {
        id: btn2
        width: 150
        height: 40
        anchors.top: btn1.bottom
        onClicked: {
            pageLoader.source = "mediaobj-rtsp-player.qml"
        }
        text: "mediaobj rtsp player"
    }

    Button {
        id: btn3
        width: 150
        height: 40
        anchors.top: btn2.bottom
        onClicked: {
            gstSame2Mp4.start()
        }
        text: "save to mp4"
    }

    Button {
        width: 150
        height: 40
        anchors.top: btn3.bottom
        onClicked: {
            gstSame2Mp4.stop()
        }
        text: "stop"
    }


    Loader {
        id: pageLoader
        asynchronous: true
        anchors.centerIn: parent
        onStatusChanged: {
            if(pageLoader.status == Loader.Ready){
                console.log("page loader is ready")
            }
        }
    }
}
